package a.h;

import a.j.gb;

import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
import java.awt.geom.GeneralPath;
import java.awt.geom.PathIterator;

public class v
  implements ListCellRenderer, TableCellRenderer
{
  private final DefaultListCellRenderer a;
  private final DefaultTableCellRenderer b;
  private gb c;
  public static final byte d = 3;
  public static final byte e = 1;
  public static final byte f = 2;
  public static final byte g = 4;
  private byte h;
  public static boolean i;
  
  public v()
  {
    this((byte)3);
  }
  
  public v(byte paramByte)
  {
    this.h = paramByte;
    this.c = new gb();
    this.a = new DefaultListCellRenderer()
    {
      public void paintComponent(Graphics paramAnonymousGraphics)
      {
        super.paintComponent(paramAnonymousGraphics);
        v.this.a(this, paramAnonymousGraphics);
      }
    };
    this.b = new DefaultTableCellRenderer()
    {
      public void paintComponent(Graphics paramAnonymousGraphics)
      {
        super.paintComponent(paramAnonymousGraphics);
        v.this.a(this, paramAnonymousGraphics);
      }
    };
  }
  
  public byte a()
  {
    return this.h;
  }
  
  public void a(byte paramByte)
  {
    this.h = paramByte;
  }
  
  public Component getListCellRendererComponent(JList paramJList, Object paramObject, int paramInt, boolean paramBoolean1, boolean paramBoolean2)
  {
    int j = ec.t;
    JLabel localJLabel = (JLabel)this.a.getListCellRendererComponent(paramJList, paramObject, paramInt, paramBoolean1, paramBoolean2);
    localJLabel.setPreferredSize(new Dimension(30, 20));
    localJLabel.setText("");
    if (j == 0)
    {
      if ((paramObject instanceof gb))
      {
        if (j != 0) {
          break label79;
        }
        this.c = ((gb)paramObject);
      }
    }
    else {
      if (!ec.s) {
        break label83;
      }
    }
    label79:
    this.c = null;
    label83:
    return localJLabel;
  }
  
  public Component getTableCellRendererComponent(JTable paramJTable, Object paramObject, boolean paramBoolean1, boolean paramBoolean2, int paramInt1, int paramInt2)
  {
    int j = ec.t;
    JLabel localJLabel = (JLabel)this.b.getTableCellRendererComponent(paramJTable, paramObject, paramBoolean1, paramBoolean2, paramInt1, paramInt2);
    localJLabel.setPreferredSize(new Dimension(30, 20));
    localJLabel.setText("");
    if (j == 0)
    {
      if ((paramObject instanceof gb))
      {
        if (j != 0) {
          break label81;
        }
        this.c = ((gb)paramObject);
      }
    }
    else {
      if (!ec.s) {
        break label85;
      }
    }
    label81:
    this.c = null;
    label85:
    return localJLabel;
  }
  
  void a(JComponent paramJComponent, Graphics paramGraphics)
  {
    int k = ec.t;
    boolean bool = ec.s;
    Graphics2D localGraphics2D = (Graphics2D)paramGraphics;
    Dimension localDimension = paramJComponent.getSize();
    Color localColor = localGraphics2D.getColor();
    Stroke localStroke = localGraphics2D.getStroke();
    Object localObject1 = localGraphics2D.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
    try
    {
      localGraphics2D.setColor(paramJComponent.getForeground());
      localGraphics2D.setStroke(c.e);
      localGraphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      Insets localInsets = paramJComponent.getInsets();
      if ((k != 0) || (localInsets == null)) {
        localInsets = new Insets(0, 0, 0, 0);
      }
      Line2D.Double[] arrayOfDouble = a(localInsets, localDimension);
      GeneralPath localGeneralPath = new GeneralPath();
      Line2D.Double localDouble;
      if (k == 0)
      {
        if (this.c != null)
        {
          this.c.a(0.0D, 0.0D, localDimension.getWidth(), localDimension.getHeight());
          this.c.a();
        }
      }
      else
      {
        if (k == 0) {
          if (this.c.b() == 0)
          {
            j = 0;
            do
            {
              if (j >= arrayOfDouble.length) {
                break;
              }
              localDouble = arrayOfDouble[j];
              a(localDouble, localGeneralPath, localGraphics2D);
              j++;
            } while (!bool);
          }
        }
        j = 0;
        do
        {
          do
          {
            if (j >= arrayOfDouble.length) {
              break;
            }
            localDouble = arrayOfDouble[j];
            this.c.b(localDouble.x1, localDouble.y1, localDouble.x2, localDouble.y2);
            j++;
            if (k != 0) {
              break label276;
            }
            if (bool) {
              break label274;
            }
          } while (!bool);
        } while (k != 0);
        j = 0;
        label274:
        label276:
        do
        {
          if (j >= arrayOfDouble.length) {
            break;
          }
          localDouble = arrayOfDouble[j];
          a(localDouble, localGeneralPath, localGraphics2D);
          j++;
        } while (!bool);
      }
      int j = 0;
      do
      {
        if (j >= arrayOfDouble.length) {
          break;
        }
        localDouble = arrayOfDouble[j];
        localGraphics2D.draw(localDouble);
        j++;
      } while (!bool);
    }
    finally
    {
      localGraphics2D.setColor(localColor);
      localGraphics2D.setStroke(localStroke);
      localGraphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, localObject1);
    }
  }
  
  private Line2D.Double[] a(Insets paramInsets, Dimension paramDimension)
  {
    int j = paramInsets.top + (int)((paramDimension.getHeight() - paramInsets.top - paramInsets.bottom) / 2.0D);
    switch (this.h)
    {
    case 3: 
    default: 
      localDouble1 = new Line2D.Double(paramInsets.left + 5, j, (int)(paramDimension.getWidth() - 5.0D - paramInsets.right), j);
      localDouble2 = new Line2D.Double(localDouble1.x1 * 0.75D + localDouble1.x2 * 0.25D, paramInsets.top + 1, localDouble1.x1 * 0.75D + localDouble1.x2 * 0.25D - 4.0D, paramDimension.getHeight() - paramInsets.bottom - 1.0D);
      localDouble3 = new Line2D.Double(localDouble2.x1 + 20.0D, localDouble2.y1, localDouble2.x2 + 20.0D, localDouble2.y2);
      Line2D.Double localDouble4 = new Line2D.Double(localDouble2.x1 + 25.0D, localDouble2.y1, localDouble2.x2 + 25.0D, localDouble2.y2);
      Line2D.Double localDouble5 = new Line2D.Double(localDouble2.x1 + 40.0D, localDouble2.y1, localDouble2.x2 + 40.0D, localDouble2.y2);
      return new Line2D.Double[] { localDouble2, localDouble3, localDouble4, localDouble1, localDouble5 };
    case 2: 
      localDouble1 = new Line2D.Double(paramInsets.left + 5, j, (int)(paramDimension.getWidth() - 5.0D - paramInsets.right), j);
      localDouble2 = new Line2D.Double(localDouble1.x1 * 0.33D + localDouble1.x2 * 0.67D, paramInsets.top + 1, localDouble1.x1 * 0.33D + localDouble1.x2 * 0.67D, paramDimension.getHeight() - paramInsets.bottom - 1.0D);
      localDouble3 = new Line2D.Double(localDouble1.x1 * 0.67D + localDouble1.x2 * 0.33D, paramInsets.top + 1, localDouble1.x1 * 0.67D + localDouble1.x2 * 0.33D, paramDimension.getHeight() - paramInsets.bottom - 1.0D);
      return new Line2D.Double[] { localDouble2, localDouble1, localDouble3 };
    case 1: 
      localDouble1 = new Line2D.Double(paramInsets.left + 5, j, (int)(paramDimension.getWidth() - 5.0D - paramInsets.right), j);
      localDouble2 = new Line2D.Double(localDouble1.x1 * 0.5D + localDouble1.x2 * 0.5D + 2.0D, paramInsets.top + 1, localDouble1.x1 * 0.5D + localDouble1.x2 * 0.5D - 2.0D, paramDimension.getHeight() - paramInsets.bottom - 1.0D);
      return new Line2D.Double[] { localDouble2, localDouble1 };
    }
    Line2D.Double localDouble1 = new Line2D.Double(paramInsets.left + 5, j, (int)(paramDimension.getWidth() - 5.0D - paramInsets.right), j);
    Line2D.Double localDouble2 = new Line2D.Double(localDouble1.x1 * 0.5D + localDouble1.x2 * 0.5D + 2.0D - 3.0D, paramInsets.top + 1, localDouble1.x1 * 0.5D + localDouble1.x2 * 0.5D - 2.0D - 3.0D, paramDimension.getHeight() - paramInsets.bottom - 1.0D);
    Line2D.Double localDouble3 = new Line2D.Double(localDouble1.x1 * 0.5D + localDouble1.x2 * 0.5D + 2.0D + 3.0D, paramInsets.top + 1, localDouble1.x1 * 0.5D + localDouble1.x2 * 0.5D - 2.0D + 3.0D, paramDimension.getHeight() - paramInsets.bottom - 1.0D);
    return new Line2D.Double[] { localDouble2, localDouble3, localDouble1 };
  }
  
  private void a(Shape paramShape, GeneralPath paramGeneralPath, Graphics2D paramGraphics2D)
  {
    PathIterator localPathIterator = this.c.a(paramShape.getPathIterator(null, 1.0D));
    paramGeneralPath.reset();
    paramGeneralPath.append(localPathIterator, false);
    paramGraphics2D.draw(paramGeneralPath);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.v

 * JD-Core Version:    0.7.0.1

 */